package com.jt.service;

import com.jt.mapper.RightsMapper;
import com.jt.pojo.Rights;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RightsServiceImpl implements RightsService {

    @Autowired
    private RightsMapper rightsMapper;

    @Override
    public List<Rights> getRightsList() {
       int parentId = 0;

        List<Rights> oneList = rightsMapper.findByParentId(parentId);
//        for (Rights oneRights : oneList){
//            int oneId = oneRights.getId();
//            List<Rights> twoList = rightsMapper.findByParentId(oneId);
//            oneRights.setChildren(twoList);
//        }

        return oneList;
    }
}